<?php
class Test extends TdPage {
	public $user;
	
  function __construct() {
  	parent::__construct();
  	
  	$this->user = new cl_User("gattoarancione");
  	
  	$newuser = new cl_User();
  	$newuser->setEmail("pinco.pallino@gmail.com");
  	$newuser->setUsername("pinco");
  	$newuser->setPassword("aaa");
  	$newuser->create();
  	
  	$newuser->setName("Pinco");
  	$newuser->setSurname("Pallino");
  	$newuser->save();
  	
  	$this->user = $newuser;
  	
  	$this->user->delete();
  }
  
  function doInit() {
	  $form = new TdForm("form");
	  $form->setAction("test.htm");

	  $fs = new TdFieldset("set");
	  
	  $field1 = new TdTextField("name");
	  $field1->setRequired(TRUE);
	  $fs->addField($field1);

	  $field2 = new TdTextField("surname");
	  $field2->setRequired(TRUE);
	  $fs->addField($field2);
	
	  $field3 = new TdEmailField("email");
	  $fs->addField($field3);
	
	  $form->addField($fs);
	  
	  $submit = new TdSubmitField("submit");
	  $submit->setValue("Submit");
	  $form->addField($submit);
	
	  $this->addComponent($form);
  }
}
?>